<?php
/* @var $this ChequeController */
/* @var $model Cheque */

$this->breadcrumbs=array(
	'Cheques'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'Crear Cheque', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#cheque-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php echo CHtml::link('Busqueda Avanzada','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'cheque-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		array('name'=>'fecha','value'=>'Yii::app()->dateFormatter->format("dd/MM/yyyy",strtotime($data->fecha))'),
		array('name'=>'cliente',
				'value'=>'$data->cliente0->nombre'),
		'prefijo_comprobante',
		'numero_comprobante',
		//array('name'=>'banco','value'=>'isset($data->banco0->descripcion)?$data->banco0->descripcion:"-"'),
		array(
				'name'=>'importe',
				'value'=>'"$ ". $data->importe'
				),

		'saldado:boolean',

		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
